package com.gs.xbinfomytest.entity;

import com.gitee.hengboy.mybatis.enhance.common.annotation.Column;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Id;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Table;
import com.gitee.hengboy.mybatis.enhance.common.enums.KeyGeneratorTypeEnum;
import lombok.Data;

import javax.persistence.Transient;
import java.sql.Timestamp;
import java.util.List;

/**
 * 菜单权限表
 * @author ApiBoot Mybatis Enhance Codegen
 */
@Data
@Table(name = "sys_menu")
public class SysMenu implements java.io.Serializable {

    /**
     * 菜单ID
     */
    @Id(generatorType = KeyGeneratorTypeEnum.AUTO)
    @Column(name = "menu_id")
    private Long menuId;
    /**
     * 菜单名称
     */
    @Column(name = "menu_name")
    private String menuName;
    /**
     * 父菜单ID
     */
    @Column(name = "parent_id")
    private Long parentId;
    /**
     * 显示顺序
     */
    @Column(name = "order_num")
    private Integer orderNum = 0;
    /**
     * 请求地址
     */
    @Column(name = "url")
    private String url = "#";
    /**
     * 打开方式（menuItem页签 menuBlank新窗口）
     */
    @Column(name = "target")
    private String target;
    /**
     * 菜单类型（M目录 C菜单 F按钮）
     */
    @Column(name = "menu_type")
    private String menuType;
    /**
     * 菜单状态（0显示 1隐藏）
     */
    @Column(name = "visible")
    private String visible = "0";
    /**
     * 权限标识
     */
    @Column(name = "perms")
    private String perms;
    /**
     * 菜单图标
     */
    @Column(name = "icon")
    private String icon = "#";
    /**
     * 创建者
     */
    @Column(name = "create_by")
    private String createBy;
    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Timestamp createTime;
    /**
     * 更新者
     */
    @Column(name = "update_by")
    private String updateBy;
    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Timestamp updateTime;
    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    @Transient
    private List<SysMenu> children;


    @Override
    public String toString() {
        return "SysMenu{" +
                "menuId=" + menuId +
                ", menuName='" + menuName + '\'' +
                ", parentId=" + parentId +
                ", orderNum=" + orderNum +
                ", url='" + url + '\'' +
                ", target='" + target + '\'' +
                ", menuType='" + menuType + '\'' +
                ", visible='" + visible + '\'' +
                ", perms='" + perms + '\'' +
                ", icon='" + icon + '\'' +
                ", createBy='" + createBy + '\'' +
                ", createTime=" + createTime +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime=" + updateTime +
                ", remark='" + remark + '\'' +
                ", children=" + children +
                '}';
    }
}

